package com.tedu.springdemo.day04;

import com.tedu.springdemo.day04.NetConnection;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;


@Component
//先去创建一个 这个类对象    bean则负责 显示
public class NetConnectionUnstaticFactory {
    @Bean("nc")
    public NetConnection getInstance()
    {
        NetConnection nc=new NetConnection();
        nc.load();
        nc.conn();
        nc.ping();
        return nc;
    }
}
